Component({
  data: {
    selected: 0,
    color: "#86909c",
    selectedColor: "#0052d9",
    list: [
      {
        pagePath: "/pages/home/home",
        text: "首页",
        iconPath: "/images/home.png",
        selectedIconPath: "/images/home-active.png"
      },
      {
        pagePath: "/pages/demand-list/demand-list",
        text: "求购",
        iconPath: "/images/search.png",
        selectedIconPath: "/images/search-active.png"
      },
      {
        pagePath: "/pages/publish-select/publish-select",
        text: "发布",
        iconPath: "/images/publish.png",
        selectedIconPath: "/images/publish-active.png"
      },
      {
        pagePath: "/pages/logs/logs",
        text: "客服",
        iconPath: "/images/search.png",
        selectedIconPath: "/images/search-active.png"
      },
      {
        pagePath: "/pages/profile/profile",
        text: "我的",
        iconPath: "/images/user.png",
        selectedIconPath: "/images/user-active.png"
      }
    ]
  },

  methods: {
    switchTab: function(e) {
      const data = e.currentTarget.dataset;
      const url = data.path;
      wx.switchTab({ url: url });
    }
  }
});
